import request from '@/utils/request'

// 创建积分
export function createPoints(data) {
  return request({
    url: '/lfd/points/create',
    method: 'post',
    data: data
  })
}

// 更新积分
export function updatePoints(data) {
  return request({
    url: '/lfd/points/update',
    method: 'put',
    data: data
  })
}

// 删除积分
export function deletePoints(id) {
  return request({
    url: '/lfd/points/delete?id=' + id,
    method: 'delete'
  })
}

// 获得积分
export function getPoints(id) {
  return request({
    url: '/lfd/points/get?id=' + id,
    method: 'get'
  })
}

// 获得积分分页
export function getPointsPage(query) {
  return request({
    url: '/lfd/points/page',
    method: 'get',
    params: query
  })
}

// 导出积分 Excel
export function exportPointsExcel(query) {
  return request({
    url: '/lfd/points/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
